/**
 * 
 */
package com.evon.yardmanagement.model;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.engine.FetchStyle;

/**
 * @author Sandeep
 * 
 */
@Entity
@Table(name = "KEY_BOX")
@AttributeOverride( name="id", column = @Column(name="KEY_BOX_ID") )
public class KeyBox extends BaseModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	@Column(name = "KEY_BOX_NUMBER")
	private int boxNumber;
	
	@Column(name = "KEY_BOX_NAME")
	private String name;

	@Column(name = "OCCUPIED")
	private int occupied;
	
	@Column(name = "ACTIVE")
	private int isActive;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="KEY_BIN_ID",referencedColumnName="KEY_BIN_ID")
	private KeyBin keyBin;

	public int getBoxNumber() {
		return boxNumber;
	}

	public void setBoxNumber(int boxNumber) {
		this.boxNumber = boxNumber;
	}
	
	

	public int getIsActive() {
		return isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isOccupied() {
		 if(occupied == 0)
			return false;
		 return true;
	}

	public void setOccupied(int occupied) {
		this.occupied = occupied;
	}

	public KeyBin getKeyBin() {
		return keyBin;
	}

	public void setKeyBin(KeyBin keyBin) {
		this.keyBin = keyBin;
	}

	public int getOccupied() {
		return occupied;
	}

}
